import java.util.Scanner;

/**
 * Created with IntelliJ IDEA
 * Description
 * User:user
 * Date:2021-10-13
 * Time:17:24
 */
public class TestDemo02 {
    //最大公约数在数学上的算法有很多种，这里讲解一种辗转相除法
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num1 = scan.nextInt();
        int num2 = scan.nextInt();
        int c = num1 % num2;
        while(c != 0){
            num1 = num2;
            num2 = c;
            c = num1 % num2;
        }
        System.out.println(num1 +"与"+num2+"的最小约倍数为"+num2);
    }




    //打印输出9*9乘法口诀表
    public static void main7(String[] args) {
        for (int i = 1; i <= 9 ; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(i + "*"+ j +"="+i*j+"  ");
            }
            System.out.println();
        }
    }

    //输出1000到2000之间的闰年
    public static void main6(String[] args) {
        for( int y = 1000;y <= 2000;y++){
            if((y % 400 == 0) || ((y % 4 == 0)&&(y % 100)!=0)){
                System.out.println(y+"是素数");
            }
        }
    }
    
    //输出2到输入数字之间的素数
    public static void main5(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        if(n == 1){
            System.out.println("1不是素数");
        }
        for (int j = 2; j <= n ; j++) {
            int i = 2;
            for(; i <= Math.sqrt(j);i++){
                if(j % i == 0){
                    //System.out.println("不是素数");
                    break;
                }
            }
            if(i > Math.sqrt(j)){
                System.out.println(j + "是素数");
            }
        }

    }
    //判断一个数是不是素数的优化
    public static void main4(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int i = 2;
        for (; i <= num / 2; i++) {
            if(num % i == 0){
                System.out.println("不是素数");
                break; }
        }
        if(i > num / 2){
            System.out.println("是素数");
        }
    }
    //判断一个数是不是素数的优化
    public static void main3(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int i = 2;
        //这也是一种优化手段for(;i <= n/2; ++)
        for(;i <= Math.sqrt(num);i++){
                if(num % i == 0){
                    System.out.println("不是素数");
                    break;
                }
        }
        if(i > Math.sqrt(num)){
            System.out.println("不是素数");
        }

    }
    //求素数最基本的方法
    public static void main2(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        if(n == 1){
            System.out.println("1既不是素数也不是合数");
        }
        int i = 2;
        for (; i < n; i++) {
            if(n % i == 0){
                System.out.println("不是素数");
                break;
            }
        }
        if(i == n){
            System.out.println("是素数");
        }
    }
    //判断青年老年中年
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextInt()){
            int age = scan.nextInt();
            if(age < 18){
                System.out.println("少年");
            }else if (age >= 18 && age <= 28){
                System.out.println("青年");
            }else if(age >= 29 && age <= 55){
                System.out.println("中年");
            }else{
                System.out.println("老年");
            }
        }
    }
}
